#include	"alp_global_vars.h"
#include	"config_parser.h"
void coordinator_execute_phase_2_a(int i, int r, paxos_msg *msg) {

	int VALUE;

//	paxos_instances[(i % INTERNAL_BUFFER_SIZE)].rnd = 0;
//	paxos_instances[(i % INTERNAL_BUFFER_SIZE)].vrnd = 0;
//	paxos_instances[(i % INTERNAL_BUFFER_SIZE)].vval = 0;
//	paxos_instances[(i % INTERNAL_BUFFER_SIZE)].crnd = 1;// before =0
//	paxos_instances[(i % INTERNAL_BUFFER_SIZE)].cval = 0;

//	if (paxos_instances[(i % INTERNAL_BUFFER_SIZE)].crnd == r && paxos_instances[(i % INTERNAL_BUFFER_SIZE)].cval == 0) {
		VALUE = data[(i % (INTERNAL_BUFFER_SIZE * get_config_info()->total_num_proposers))].packet.pack_id;
//		paxos_instances[(i % INTERNAL_BUFFER_SIZE)].cval = VALUE;

		msg->instance_number = i;
		msg->round_number = r;
		msg->type = PHASE_2_A;
		msg->max_vval = -1;
		msg->max_vrnd = -1;
		msg->VALUE = VALUE;
		msg->acceptor_count = 0;
		execute_phase_2_b(msg);
//	}
}
